/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tvunetworks.service.impl;

import com.tvunetworks.dao.OrderDao;
import com.tvunetworks.dao.SequenceDao;
import com.tvunetworks.model.Order;
import com.tvunetworks.service.OrderManager;
import java.util.List;
import javax.jws.WebService;
import org.springframework.beans.factory.annotation.Required;

/**
 *
 * @author michael
 */
@WebService(serviceName = "OrderService", endpointInterface = "com.tvunetworks.service.OrderService")
public class OrderManagerImpl extends GenericManagerImpl<Order, Integer> implements OrderManager {

    private OrderDao orderDao;
    private SequenceDao sequenceDao;

    public OrderDao getOrderDao() {
        return orderDao;
    }

    @Required
    public void setOrderDao(OrderDao orderDao) {
        this.orderDao = orderDao;
    }

    public SequenceDao getSequenceDao() {
        return sequenceDao;
    }

    @Required
    public void setSequenceDao(SequenceDao sequenceDao) {
        this.sequenceDao = sequenceDao;
    }

    public int getNextId(String key) {
        return sequenceDao.getNextId(key);
    }

    public Order getOrder(Integer orderId) {
        return orderDao.getOrder(orderId);
    }

    public List<Order> getOrderByUsername(String username) {
        return orderDao.getOrdersByUsername(username);
    }

    public void insertOrder(Order order) {
        orderDao.insertOrder(order);
    }
}
